package com.itheima.个人代码.IO流2;


import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Demo6 {
    public static void main(String[] args) throws IOException {
        //FileReaderChacarter();
        //FileReaderCharArray();

    }

    public static void FileReaderCharArray() throws IOException {
        FileReader fr=new FileReader("IO流2和对象操作流properties\\stu.txt");
        char[] chars=new char[1024];
        int len;
        while((len=fr.read(chars))!=-1){
            System.out.println(new String(chars,0,len));
        }
    }

    public static void FileReaderChacarter() throws IOException {
        FileReader fr=new FileReader("IO流2和对象操作流properties\\stu.txt");
        int ch;
        while((ch=fr.read())!=-1){
            System.out.print((char)ch);
        }
    }
}
